package org.example;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

class Player {
        protected int color;
        protected List<Point> chessList = new ArrayList<>();

        public Player() {
            this.color = 0;
        }
        public Player(int color) {
            this.color = color;
        }

        public int getColor() {
            return color;
        }
        public void setColor(int color) {
            this.color = color;
        }

        public List<Point> getChessList() {
            return chessList;
        }
        public void setChessList(List<Point> chessList) {
            this.chessList = chessList;
        }

        //随即生成一个棋子颜色
        public void generateChess()
        {
            Random random = new Random();
            this.color = random.nextInt(1)+1;
        }

        //检测另一位玩家的棋子颜色，并生成自己的颜色
        public void checkChess(Player player)
        {
            if(player.getColor() == 1)
            {
                this.color = 2;
            }
            else
            {
                this.color = 1;
            }
        }


    }

